package com.ruoyi.english.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.english.mapper.EnWordMapper;
import com.ruoyi.english.domain.EnWord;
import com.ruoyi.english.service.IEnWordService;

/**
 * 单词Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-25
 */
@Service
public class EnWordServiceImpl implements IEnWordService 
{
    @Autowired
    private EnWordMapper enWordMapper;

    /**
     * 查询单词
     * 
     * @param wordId 单词主键
     * @return 单词
     */
    @Override
    public EnWord selectEnWordByWordId(Long wordId)
    {
        return enWordMapper.selectEnWordByWordId(wordId);
    }

    /**
     * 查询单词列表
     * 
     * @param enWord 单词
     * @return 单词
     */
    @Override
    public List<EnWord> selectEnWordList(EnWord enWord)
    {
        return enWordMapper.selectEnWordList(enWord);
    }

    /**
     * 新增单词
     * 
     * @param enWord 单词
     * @return 结果
     */
    @Override
    public int insertEnWord(EnWord enWord)
    {
        enWord.setCreateTime(DateUtils.getNowDate());
        return enWordMapper.insertEnWord(enWord);
    }

    /**
     * 修改单词
     * 
     * @param enWord 单词
     * @return 结果
     */
    @Override
    public int updateEnWord(EnWord enWord)
    {
        return enWordMapper.updateEnWord(enWord);
    }

    /**
     * 批量删除单词
     * 
     * @param wordIds 需要删除的单词主键
     * @return 结果
     */
    @Override
    public int deleteEnWordByWordIds(Long[] wordIds)
    {
        return enWordMapper.deleteEnWordByWordIds(wordIds);
    }

    /**
     * 删除单词信息
     * 
     * @param wordId 单词主键
     * @return 结果
     */
    @Override
    public int deleteEnWordByWordId(Long wordId)
    {
        return enWordMapper.deleteEnWordByWordId(wordId);
    }
}
